package com.canaan.business.common.enums.basic;

/**
 * 仓库权限枚举
 */
public enum StorehousePermissionEnum {

    YARDAGE_GOODS(1, "码货单管理"),
    IN_PRODUCTION(2, "生产入库单管理"),
    IN_STORES_RETURNED(3, "退料入库单管理"),
    IN_SCRAP(4, "报废入库单管理"),
    IN_SALES_REFUND(5, "退货入库单管理"),
    IN_WAIT_INSPECTION(6, "待检入库单管理"),
    IN_RECEIVING(7, "收货入库单管理"),
    IN_ALLOCATE(8, "调拨入库单管理"),
    IN_OTHER(9, "其他入库单管理"),
    PICKER(10, "拣货单管理"),
    OUT_SALES(11, "销售出库单管理"),
    OUT_PICK(12, "领料出库单管理"),
    OUT_SCRAP(13, "报废出库单管理"),
    OUT_ADJUST(14, "调拨出库单管理"),
    OUT_OTHER(15, "其他出库单管理"),
    OUT_RETURN(16, "退货出库管理"),
    ;

    private final Integer code;
    private final String message;

    StorehousePermissionEnum(Integer code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        if(code == null){
            return null;
        }
        String message = null;
        for (StorehousePermissionEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
